package com.ibm.cps.newmessage;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.KryoSerializable;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.ibm.cps.message.MessageFields;
import com.ibm.cps.message.validation.ValidatorUtil;
import com.ibm.util.JSONUtility;
import com.ibm.util.exception.CPSException;

public class JointMetadata extends AbstractMetadata implements KryoSerializable {

	public JointMetadata() {

	}

	public JointMetadata(String input) throws CPSException {
		this(JSONUtility.fromObjectString(input));
	}

	public JointMetadata(ObjectNode object) throws CPSException {
		super(object);
		String parentString = key2value.get(MessageFields.PARENTPROCESSORS);
		ValidatorUtil
				.checkNotNull(MessageFields.PARENTPROCESSORS, parentString);
		this.parentProcessors = JSONUtility.getArrayList(parentString);
	}

	@Override
	public void write(Kryo kryo, Output output) {

	}

	@Override
	public void read(Kryo kryo, Input input) {

	}

}
